package com.bicon.botu.mall.order.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import com.bicon.botu.mall.order.entity.OrderRecords;
import com.bicon.botu.mall.order.service.IOrderRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器(订单记录)
 * </p>
 *
 * @author 李双喜
 * @since 2018-06-27
 */
@RestController
@RequestMapping("/V3.0.0/order-record")
public class OrderRecordsController extends BaseController {
    @Autowired
    private IOrderRecordsService iOrderRecordsService;

    /**
     * 分页查询订单记录
     *
     * @param pageNo       当前页码
     * @param pageSize     每页显示条数
     * @param orderGoodsId 店铺id
     * @return
     */
    @RequestMapping(value = "/select-page", method = RequestMethod.POST)
    public BaseResult selectPage(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam String orderGoodsId) {
        Page<OrderRecords> page = iOrderRecordsService.selectPageRecord(pageNo, pageSize, orderGoodsId);
        return new BaseResult(200, "success", page);
    }


}
